package com.lc202406;

public class Solution2315 {
    public int countAsterisks(String s) {
        String[] arr = s.split("\\|");
        int length = arr.length;
        int count = 0;
        for (int i = 0; i < length; i = i + 2) {
            String str = arr[i];
            int nums = str.length();
            for (int j = 0; j < nums; j++) {
                if (str.charAt(j) == '*') {
                    count++;
                }
            }
        }
        return count;
    }

}
